# demo06_read_big_file.py
# fr.readlines():
# 将一个文件中的每一行数据当成一个元素逐一添加到列表中, 并将该列表返回
fr = open("/etc/hosts", mode="r")
for line in fr.readlines():  # in fr.readlines() -> in fr:
    print(line, end="")
fr.close()
# abc
# def
# ghi
# ["abc", "def", "ghi"]


# fr = open("/etc/passwd", mode="r")  # 1. 打开文件
# # 2. 读取文件
# while True:
#     content = fr.readline()  # xxxxxxx\n
#     if content == "":  # if not content:
#         break
#     print(content, end="")
# fr.close()  # 3. 关闭资源
